1. Field of the Invention
The present invention relates to a computer program product, system, and method for determining whether to extend a drain time to copy data blocks from a first storage to a second storage.
2. Description of the Related Art
Disaster recovery systems typically address two types of failures, a sudden catastrophic failure at a single point-in-time or data loss over a period of time. In the second type of gradual disaster, updates to volumes may be lost. To assist in recovery of data updates, a copy of data may be provided at a remote location. Such dual or shadow copies are typically made as the application system is writing new data to a primary storage device. Different copy technologies may be used for maintaining remote copies of data at a secondary site, such as International Business Machine Corporation's (“IBM”) Extended Remote Copy (XRC), Coupled XRC (CXRC), Global Copy, and Global Mirror Copy.
In data mirroring systems, data is maintained in volume pairs. A volume pair is comprised of a volume in a primary storage device and a corresponding volume in a secondary storage device that includes an identical copy of the data maintained in the primary volume. Primary and secondary servers may be used to control access to the primary and secondary storage devices. In certain data mirroring systems, a timer is used to provide a uniform time across systems so that updates written by different applications to different primary storage devices use consistent time-of-day (TOD) value as a time stamp. The host operating system or the application may time stamp updates to a data set or set of data sets when writing such data sets to volumes in the primary storage. The integrity of data updates is related to insuring that updates are done at the secondary volumes in the volume pair in the same order as they were done on the primary volume. The time stamp provided by the application program determines the logical sequence of data updates.
In many application programs, such as database systems, certain writes cannot occur unless a previous write occurred; otherwise the data integrity would be jeopardized. Such a data write whose integrity is dependent on the occurrence of a previous data write is known as a dependent write. Volumes in the primary and secondary storages are consistent when all writes have been transferred in their logical order, i.e., all dependent writes transferred first before the writes dependent thereon. A consistency group has a consistency time for all data writes in a consistency group having a time stamp equal or earlier than the consistency time stamp. A consistency group is a collection of updates to the primary volumes such that dependent writes are secured in a consistent manner. The consistency time is the latest time to which the system guarantees that updates to the secondary volumes are consistent. Consistency groups maintain data consistency across volumes and storage devices. Thus, when data is recovered from the secondary volumes, the recovered data will be consistent.
One technique to provide a consistent point-in-time copy of data is to suspend all writes to the primary storage and then while writes are suspended copy all the data to mirror to the secondary storage or backup device. A disadvantage of this technique is that host writes are suspended for the time to create a point-in-time copy of data, which may adversely effect application processing at the host. An alternative technique is to establish a logical copy of data at the primary storage, which takes a very short period of time, such as no more than a second or two. Thus, suspending host writes to the primary storage during the time to establish the logical copy is far less disruptive to host application processing than would occur if host writes were suspended for the time to copy all the source data to the target volume. After establishing the logical copy, source volume data subject to an update is copied to a target volume so that the target volume has the data as of the point-in-time the logical copy was established at the primary storage, before the update. This defers the physical copying until an update is received. This logical copy operation is performed to minimize the time during which the target and source volumes are inaccessible.
To drain or copy a consistency group of data from a primary storage to a secondary storage, the primary system maintains indication of the blocks of data in the consistency group to drain. During the drain operation, host writes to the data being drained, also known as collisions, are delayed until the drain of that block completes. Thus, the drain operation may have a negative impact on host performance because the time to complete write requests is delayed. A drain time period may be set during which the data in the consistency group is copied to the secondary storage and host writes to the data not copied over, i.e., collisions, are queued and delayed. The drain operation is failed if the draining of all the data blocks in the consistency group is not completed within the drain time period. In such case, the operations to drain the consistency group must be performed again and subject to the same risk that the drain operation may not complete within the time provided for the drain operations.
There is a need in the art for improved techniques for draining data from a first storage to a second storage.